package com.aiden.cashbook

import com.aiden.cashbook.bean.OrderDataBean
import com.aiden.cashbook.bean.User
import com.google.gson.Gson
import org.junit.Test

import org.junit.Assert.*

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }

    @Test
    fun test() {
        val user = User("123", "123", "11234", "M", "112")
//        System.out.println(Gson().toJson(user, User::class.java))

        val order = OrderDataBean()
        order.code = "100"
        val product = OrderDataBean.ProductsBean("111", "11", "11", "111")
        val product2 = OrderDataBean.ProductsBean("122", "122", "122", "122")
        val list = ArrayList<OrderDataBean.ProductsBean>()
        list.add(product)
        list.add(product2)
        order.products = list
        System.out.println(Gson().toJson(order, OrderDataBean::class.java))
    }
}
